package com.yuehua.learn.server;

import com.yuehua.learn.server.annotation.Decrypt;
import com.yuehua.learn.server.req.PostReq;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

@Decrypt
@RestController
@SpringBootApplication
public class ServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServerApplication.class, args);
    }

    @GetMapping("/get")
    public String get(String param) {
        return param;
    }

    @GetMapping("/get/{pathVal}")
    public String getPathVal(@PathVariable String pathVal) {
        return pathVal;
    }

    @PostMapping("/post")
    public String postVal(@RequestBody PostReq req) {
        return req.getParam();
    }

}
